package com.prs.crm.action.purchase;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Iterator;
import java.util.List;

import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.Result;
import org.courser.ui.PaginationSupport;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;
import org.springframework.beans.factory.annotation.Autowired;

import com.prs.crm.action.FlowAction;
import com.prs.crm.annotation.Clew;
import com.prs.crm.annotation.FlowActive;
import com.prs.crm.annotation.FlowStart;
import com.prs.crm.context.Constrains;
import com.prs.crm.domain.fs.BankAccount;
import com.prs.crm.domain.fs.Detail;
import com.prs.crm.domain.purchase.FundsInBar;
import com.prs.crm.domain.purchase.PaymentDetails;
import com.prs.crm.domain.purchase.PaymentGather;
import com.prs.crm.domain.purchase.PaymentOrder;
import com.prs.crm.domain.purchase.PurchaseOrder;
import com.prs.crm.domain.purchase.PurchaseOrderDetail;
import com.prs.crm.domain.purchase.PurchaseReturned;
import com.prs.crm.domain.purchase.PurchaseReturnedDetail;
import com.prs.crm.domain.purchase.PurchaseReturnedStoreOut;
import com.prs.crm.domain.purchase.PurchaseReturnedStoreOutDetail;
import com.prs.crm.domain.purchase.PurchaseStoreIn;
import com.prs.crm.domain.purchase.PurchaseStoreInDetail;
import com.prs.crm.domain.stock.Product;
import com.prs.crm.domain.stock.ProductStore;
import com.prs.crm.domain.store.StoreIn;
import com.prs.crm.domain.store.StoreRoom;
import com.prs.crm.domain.sys.Code;
import com.prs.crm.domain.sys.CodeInvoice;
import com.prs.crm.service.fs.BankAccountService;
import com.prs.crm.service.fs.DetailService;
import com.prs.crm.service.purchase.FundsInBarService;
import com.prs.crm.service.purchase.PaymentOrderService;
import com.prs.crm.service.purchase.PurchaseOrderDetailService;
import com.prs.crm.service.purchase.PurchaseOrderService;
import com.prs.crm.service.purchase.PurchaseReturnedService;
import com.prs.crm.service.purchase.PurchaseReturnedStoreOutDetailService;
import com.prs.crm.service.purchase.PurchaseReturnedStoreOutService;
import com.prs.crm.service.purchase.PurchaseStoreInDetailService;
import com.prs.crm.service.purchase.PurchaseStoreInService;
import com.prs.crm.service.stock.ProductStoreService;
import com.prs.crm.service.stock.StoreRoomService;
import com.prs.crm.service.sys.CodeInvoiceService;
import com.prs.crm.service.sys.CodeService;

/**
 * @author 兰小刚
 * @version 创建时间：2010-7-19 下午14:45:10 类说明
 */
public class PurchaseReturnedAction extends FlowAction<PurchaseReturned> {

	private static final long serialVersionUID = 1L;

	private PurchaseReturned purchaseReturned;

	private String Encode;

	private CodeInvoice codeInvoice;

	private CodeInvoiceService codeInvoiceService;

	private Code code;

	private CodeService codeService;

	private Collection<CodeInvoice> codelist;

	private PurchaseOrder purchaseOrder;

	private PurchaseOrderDetail purchaseOrderDetail;

	private PurchaseStoreIn purchaseStoreIn;

	private StoreRoom rooms;

	private FundsInBar fundsInBar;

	private Detail detailz;

	private DetailService detailService;

	private PurchaseReturnedStoreOut purchaseReturnedStoreOut;

	private PurchaseReturnedStoreOutDetail purchaseReturnedStoreOutDetail;

	private BankAccount bankAccount;

	private ProductStore productStore;

	@Autowired
	private ProductStoreService productStoreService;

	private BankAccountService bankAccountService;

	private FundsInBarService fundsInBarService;

	private PurchaseReturnedStoreOutService purchaseReturnedStoreOutService;

	private PurchaseReturnedStoreOutDetailService purchaseReturnedStoreOutDetailService;

	private PurchaseReturnedService purchaseReturnedService;

	private StoreRoomService storeRoomService;

	@Autowired
	private PurchaseStoreInService purchaseStoreInService;

	private PurchaseOrderDetailService purchaseOrderDetailService;

	private PurchaseOrderService purchaseOrderService;

	private List<StoreRoom> roomList;

	private Collection<BankAccount> bankAccounts;

	private Collection<PurchaseReturnedStoreOutDetail> slist;

	private String[] productCodes;

	private String[] productNames;

	private String[] barCodes;

	private String[] units;

	private Integer[] nums;

	private Double[] prices;

	private Double[] allPrices;

	private Double[] rebates;

	private Double[] rebateUnits;

	private Double[] rebatePrices;

	private Product[] products;
	private Integer[] storeinNum;

	private PaginationSupport pagination;
	private String listString;
	private List<PurchaseStoreInDetail> detailIn;
	private Product product;
	private String id;
	private String[] detailAll;
	private PurchaseStoreInDetailService purchaseStoreInDetailService;
	private String count;
	private PaymentOrderService paymentOrderService;

	@FlowActive(target = "purchaseReturned", flowservice = "purchaseReturnedService")
	@Action("editReturnedPurchase")
	public String editReturnedPurchase() {
		roomList = this.getStoreRoomService().getAllstoreroom();
		this.codelist = this.getCodeInvoiceService()
				.getInvoiceCodeType("采购退货单");
		return SUCCESS;
	}

	@Clew(results = { "success", "none" })
	@FlowStart(target = "purchaseReturned", flowservice = "purchaseReturnedService")
	@Action(value = "savePurchaseReturned", results = {
			@Result(name = "success", type = "redirect", location = "editReturnedPurchase"),
			@Result(name = "error", type = "chain", location = "editReturnedPurchase"),
			@Result(name = "none", type = "redirect", location = "editReturnedPurchase") })
	public String savePurchaseReturned() {

		if ("n".equals(Encode)) {
			int EncodeRplice = this.getCodeService().getBackRpliceAll("手动编码",
					"采购退货单", purchaseReturned.getBillCode());
			if (EncodeRplice != 0) {
				this.addActionError("编码重复!请重新输入");
				return ERROR;
			}
		}
		if ("x".equals(Encode) || "".equals(Encode)) {
			this.addActionError("请选择编码类型");
			return ERROR;
		}

		if (purchaseReturned.getBillCode() == null
				|| purchaseReturned.getBillCode().equals("")) {
			this.addActionError("单据编号不能为空");
			return ERROR;
		}
		if (purchaseReturned.getBillDate() == null) {
			this.addActionError("时间不能为空");
			return ERROR;
		}
		// if (purchaseReturned.getRooms() == null) {
		// this.addActionError("仓库不你能为空");
		// return ERROR;
		// }
		if (purchaseReturned.getSupplier() == null) {
			this.addActionError("供应商不能为空");
			return ERROR;
		}
		// if (purchaseReturned.getStoreIn() == null) {
		// this.addActionError("入库单不能为空");
		// return ERROR;
		// }
		if (purchaseReturned.getHandPerson() == null) {
			this.addActionError("经手人不能为空");
			return ERROR;
		}
		if (products == null) {
			this.addActionError("明细不能为空");
			return ERROR;
		}

		/**
		 * 编码产生
		 */

		if ("n".equals(Encode)) {
			Code codes = new Code();
			codes.setCodeValue(purchaseReturned.getBillCode());
			codes.setCodeMolde("采购退货单");
			codes.setEntityName(this.getClass().getName());
			codes.setCodeType("手动编码");
			this.getCodeService().save(codes);
			purchaseReturned.setCode(codes);
			this.getPurchaseReturnedService().saveAll(purchaseReturned,
					productCodes, productNames, units, nums, prices, allPrices,
					rebates, rebateUnits, rebatePrices, barCodes, products,
					detailAll, storeinNum);
		} else {
			CodeInvoice Vob = this.getCodeInvoiceService().getVobject(
					codeInvoice.getId());
			Code codes = new Code();
			codes.setCodeValue(purchaseReturned.getBillCode());
			codes.setCodeMolde("采购退货单");
			codes.setEntityName(this.getClass().getName());
			Vob.setNumBackUp(Increase(Vob.getNumBackUp()));
			this.getCodeInvoiceService().saveOrUpdate(Vob);
			codes.setCodeType(Vob.getCodePlan());
			this.getCodeService().save(codes);
			purchaseReturned.setCode(codes);
			this.getPurchaseReturnedService().saveAll(purchaseReturned,
					productCodes, productNames, units, nums, prices, allPrices,
					rebates, rebateUnits, rebatePrices, barCodes, products,
					detailAll, storeinNum);
		}

		this.setPrompt("退货成功");
		return SUCCESS;
	}

	@Clew(results = { "success", "none" })
	@Action(value = "savePurchaseReturnedStoreOut", results = {
			@Result(name = "success", type = "redirect", location = "listPurchaseReturnedStoreOut"),
			@Result(name = "error", type = "chain", location = "viewPurchaseReturnedStoreOut"),
			@Result(name = "none", type = "redirect", location = "listPurchaseReturnedStoreOut") })
	public String savePurchaseReturnedStoreOut() {
		if (products == null) {
			this.addActionError("产品不能为空");
			return ERROR;
		}
		if (purchaseReturnedStoreOut == null) {
			this.addActionError("请正确输入");
			return ERROR;
		}
		// if (purchaseReturnedStoreOut.getBatchNum() == null) {
		// this.addActionError("批号不能为空");
		// return ERROR;
		// }
		// if (purchaseReturnedStoreOut.getStoreRoom() == null) {
		// this.addActionError("仓库不能为空");
		// return ERROR;
		// }
		if (purchaseReturnedStoreOut.getOutName() == null
				|| purchaseReturnedStoreOut.getOutName().equals("")) {
			this.addActionError("主题不能为空");
			return ERROR;
		}
		if (purchaseReturnedStoreOut.getOutDate() == null) {
			this.addActionError("时间不能为空");
			return ERROR;
		}

		for (Iterator iterator = purchaseReturnedStoreOut.getDetails()
				.iterator(); iterator.hasNext();) {
			PurchaseReturnedStoreOutDetail type = (PurchaseReturnedStoreOutDetail) iterator
					.next();
			if (type.getDetailAlls() != null
					&& !type.getDetailAlls().trim().equals("")) {

				String[] all = type.getDetailAlls().trim().split(",");
				for (int c = 0; c < all.length; c++) {
					String[] val = all[c].trim().split("p");
					PurchaseStoreInDetail inDetail = this
							.getPurchaseStoreInDetailService().get(
									Integer.parseInt(val[1].trim()));
					ProductStore ProductStoreObject = this
							.getProductStoreService().getProductStoreObject(
									inDetail.getProduct(),
									inDetail.getPurchaseStoreIn().getRooms(),
									inDetail.getBatchNum());
					ProductStoreObject.setProductNum(ProductStoreObject
							.getProductNum()
							- Integer.parseInt(val[0].trim()));
					this.getProductStoreService().savePrStore(
							ProductStoreObject);

				}
			}

		}
		purchaseReturnedStoreOut.setInState(2);
		this.getPurchaseReturnedStoreOutService().savelOrUpdate(
				purchaseReturnedStoreOut);

		this.setPrompt("出库成功");
		return SUCCESS;
	}

	@Clew(results = { "success", "none" })
	@Action(value = "submitFundsInBar", results = {
			@Result(name = "success", type = "redirect", location = "listFundsInBar"),
			@Result(name = "error", type = "chain", location = "editFundsInBar"),
			@Result(name = "none", type = "redirect", location = "listFundsInBar") })
	public String submitFundsInBar() {
		if (fundsInBar.getInName() == null || fundsInBar.getInName().equals("")) {
			this.addActionError("主题不能为空");
			return ERROR;
		}
		if (fundsInBar.getBankAccount() == null) {
			this.addActionError("账户不能为空");
			return ERROR;
		}
		if (fundsInBar.getInDate() == null) {
			this.addActionError("时间不能为空");
			return ERROR;
		}
		if (fundsInBar.getInMony() == null) {
			this.addActionError("金额不能为空");
			return ERROR;
		}
		if (fundsInBar.getPerson() == null) {
			this.addActionError("入账人不能为空");
			return ERROR;
		}
		/**
		 * 入账
		 */
//		PurchaseOrder order = fundsInBar.getPurchaseOrder();
//		List<PaymentOrder> paymentOrders = this.getPaymentOrderService()
//				.getPaymentOrdersByOrder(order);
//		for (PaymentOrder order2 : paymentOrders) {
//			PaymentGather paymentGather = order2.getPaymentGather();
//			if (paymentGather != null) {
//				for (PaymentDetails paymentDetails : paymentGather.getDetails()) {
//				}
//			}
//		}
		// System.out.println(fundsInBar.getPerson().getId()+"        sdfg");
		fundsInBar.getPurchaseOrder().setReturnMoney(
				fundsInBar.getInMony()
						+ fundsInBar.getPurchaseOrder().getReturnMoney());
		Double sum = this.getDetailService().getBalanceByAccount(
				fundsInBar.getBankAccount());
		Detail detialob = new Detail();
		detialob.setFundsInBar(fundsInBar);
		detialob.setIncome(fundsInBar.getInMony());
		detialob.setPay(0.00);
		detialob.setBalance(fundsInBar.getInMony() + sum);
		detialob.setBankAccount(fundsInBar.getBankAccount());
		detialob.setItem(Constrains.FS_ITEMS_PURCHASERETURNED);
		this.getDetailService().save(detialob);
		// FundsInBar
		// FundsInBarObject=this.getFundsInBarService().getFundsInBar(fundsInBar.getId());
		// FundsInBarObject.setInDate(fundsInBar.getInDate());
		// FundsInBarObject.setBankAccount(fundsInBar.getBankAccount());
		// FundsInBarObject.setInName(fundsInBar.getInName());
		// FundsInBarObject.setRemark(fundsInBar.getRemark());
		// FundsInBarObject.setPerson(fundsInBar.getPerson());
		// FundsInBarObject.setInState(2);
		// FundsInBarObject.setModifyTime(fundsInBar.getModifyTime());
		// FundsInBarObject.set
		// fundsInBar.setRecorder(recorder);
		this.getFundsInBarService().save(fundsInBar);// .savelOrUpdate(fundsInBar);

		this.setPrompt("打帐成功");
		return SUCCESS;
	}

	@Action("listPurchaseReturned")
	public String excute() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				PurchaseReturned.class);
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getPurchaseReturnedService().listByPage(
				criteria, pagination));
		return SUCCESS;
	}

	@Action("listFundsInBar")
	public String excute1() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				FundsInBar.class);
		criteria.createAlias("purchaseOrder", "p");
		criteria.add(Restrictions.ge("inState", 0));
		criteria.add(Restrictions.gt("inMony", 0.0));
		criteria.add(Restrictions.gtProperty("p.payedMoney", "p.returnMoney"));

		pagination = this.getPaginationHelper().prepare(pagination);

		this.setPagination(this.getFundsInBarService().listByPage(criteria,
				pagination));
		return SUCCESS;
	}

	@Action("listPurchaseReturnedStoreOut")
	public String excute2() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				PurchaseReturnedStoreOut.class);
		criteria.add(Restrictions.ge("inState", 0));
		pagination = this.getPaginationHelper().prepare(pagination);
		this.setPagination(this.getPurchaseReturnedStoreOutService()
				.listByPage(criteria, pagination));
		return SUCCESS;
	}

	@Action("viewPurchaseReturnedStoreOut")
	public String editPurchaseReturnedStoreOut() {
		purchaseReturnedStoreOut = this.getPurchaseReturnedStoreOutService()
				.get(purchaseReturnedStoreOut.getId());
		this.slist = purchaseReturnedStoreOut.getDetails();
		roomList = this.getStoreRoomService().getAllstoreroom();
		return SUCCESS;
	}

	@Action("editFundsInBar")
	public String editFundsInBar() {
		fundsInBar = this.getFundsInBarService().get(fundsInBar.getId());
		bankAccounts = this.getBankAccountService().getAllBankAccount();
		return SUCCESS;
	}

	@Action("viewPurchaseReturned")
	public String viewPurchaseReturned() {
		purchaseReturned = this.getPurchaseReturnedService().get(
				purchaseReturned.getId());
		return SUCCESS;
	}

	@Action("selectPurchaseStoreIn")
	public String selectPurchaseStoreIn() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				PurchaseStoreIn.class);
		// criteria.createAlias("purchaseOrder", "b");
		// criteria.add(Restrictions.eq("flowstatus", 2));
		// criteria.add(Restrictions.gt("purchaseOrderId", 0));
		criteria.add(Restrictions.eq("outState", 0));
		this.setPagination(this.getPurchaseStoreInService().listByPage(
				criteria, getPaginationHelper().prepare(pagination)));
		return SUCCESS;
	}

	@Action("selectPurchaseOrder")
	public String selectPurchaseOrder() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				PurchaseOrder.class);
		// criteria.createAlias("purchaseOrder", "b");
		criteria.add(Restrictions.eq("flowstatus", 2));
		// criteria.add(Restrictions.gt("purchaseOrderId", 0));
		criteria.add(Restrictions.eq("returenState", 0));
		this.setPagination(this.getPurchaseStoreInService().listByPage(
				criteria, getPaginationHelper().prepare(pagination)));
		return SUCCESS;
	}

	@Action("selectPurchaseReturnedProductByIn")
	public String selectPurchaseReturnedProductByIn() {
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				PurchaseStoreInDetail.class);
		criteria.createAlias("purchaseStoreIn", "b");
		criteria.add(Restrictions.eq("b.purchaseOrder", purchaseOrder));
		criteria.add(Restrictions.eq("product", product));
		criteria.add(Restrictions.ltProperty("outNum", "inNumber"));
		this.setPagination(this.getPurchaseOrderDetailService().listByPage(
				criteria, getPaginationHelper().prepare(pagination)));
		return SUCCESS;
	}

	@Action("selectPurchaseReturnedProduct")
	public String selectPurchaseReturnedProduct() {

		List<PurchaseStoreIn> purchaseStoreIns = this
				.getPurchaseStoreInService().getPurchaseStoreInByOrder(
						purchaseOrder);
		detailIn = new ArrayList<PurchaseStoreInDetail>();
		for (PurchaseStoreIn purchaseStoreInss : purchaseStoreIns) {
			for (PurchaseStoreInDetail detail : purchaseStoreInss.getDetails()) {
				if (detail.getInNumber() - detail.getOutNum() != 0) {
					detailIn.add(detail);
				}
			}
		}
		DetachedCriteria criteria = this.getPaginationHelper().createQuery(
				PurchaseOrderDetail.class);
		// detailIn

		criteria.add(Restrictions.eq("purchaseOrder", purchaseOrder));
		criteria.add(Restrictions.eq("returnState", 0));
		this.setPagination(this.getPurchaseOrderDetailService().listByPage(
				criteria, getPaginationHelper().prepare(pagination)));
		return SUCCESS;
	}

	public PurchaseReturned getPurchaseReturned() {
		return purchaseReturned;
	}

	public void setPurchaseReturned(PurchaseReturned purchaseReturned) {
		this.purchaseReturned = purchaseReturned;
	}

	public PurchaseReturnedService getPurchaseReturnedService() {
		return purchaseReturnedService;
	}

	public void setPurchaseReturnedService(
			PurchaseReturnedService purchaseReturnedService) {
		this.purchaseReturnedService = purchaseReturnedService;
	}

	public PaginationSupport getPagination() {
		return pagination;
	}

	public void setPagination(PaginationSupport pagination) {
		this.pagination = pagination;
	}

	public StoreRoom getRooms() {
		return rooms;
	}

	public void setRooms(StoreRoom rooms) {
		this.rooms = rooms;
	}

	public StoreRoomService getStoreRoomService() {
		return storeRoomService;
	}

	public void setStoreRoomService(StoreRoomService storeRoomService) {
		this.storeRoomService = storeRoomService;
	}

	public List<StoreRoom> getRoomList() {
		return roomList;
	}

	public void setRoomList(List<StoreRoom> roomList) {
		this.roomList = roomList;
	}

	public PurchaseStoreIn getPurchaseStoreIn() {
		return purchaseStoreIn;
	}

	public void setPurchaseStoreIn(PurchaseStoreIn purchaseStoreIn) {
		this.purchaseStoreIn = purchaseStoreIn;
	}

	public PurchaseStoreInService getPurchaseStoreInService() {
		return purchaseStoreInService;
	}

	public void setPurchaseStoreInService(
			PurchaseStoreInService purchaseStoreInService) {
		this.purchaseStoreInService = purchaseStoreInService;
	}

	public PurchaseOrder getPurchaseOrder() {
		return purchaseOrder;
	}

	public void setPurchaseOrder(PurchaseOrder purchaseOrder) {
		this.purchaseOrder = purchaseOrder;
	}

	public PurchaseOrderService getPurchaseOrderService() {
		return purchaseOrderService;
	}

	public void setPurchaseOrderService(
			PurchaseOrderService purchaseOrderService) {
		this.purchaseOrderService = purchaseOrderService;
	}

	public PurchaseOrderDetail getPurchaseOrderDetail() {
		return purchaseOrderDetail;
	}

	public void setPurchaseOrderDetail(PurchaseOrderDetail purchaseOrderDetail) {
		this.purchaseOrderDetail = purchaseOrderDetail;
	}

	public PurchaseOrderDetailService getPurchaseOrderDetailService() {
		return purchaseOrderDetailService;
	}

	public void setPurchaseOrderDetailService(
			PurchaseOrderDetailService purchaseOrderDetailService) {
		this.purchaseOrderDetailService = purchaseOrderDetailService;
	}

	public String[] getProductCodes() {
		return productCodes;
	}

	public void setProductCodes(String[] productCodes) {
		this.productCodes = productCodes;
	}

	public String[] getProductNames() {
		return productNames;
	}

	public void setProductNames(String[] productNames) {
		this.productNames = productNames;
	}

	public String[] getUnits() {
		return units;
	}

	public void setUnits(String[] units) {
		this.units = units;
	}

	public Integer[] getNums() {
		return nums;
	}

	public void setNums(Integer[] nums) {
		this.nums = nums;
	}

	public Double[] getPrices() {
		return prices;
	}

	public void setPrices(Double[] prices) {
		this.prices = prices;
	}

	public Double[] getAllPrices() {
		return allPrices;
	}

	public void setAllPrices(Double[] allPrices) {
		this.allPrices = allPrices;
	}

	public Double[] getRebates() {
		return rebates;
	}

	public void setRebates(Double[] rebates) {
		this.rebates = rebates;
	}

	public static String Increase(String backupNum) {
		String Inc = "";
		int lengths = backupNum.length();
		String lengthss = (Integer.parseInt(backupNum) + 1) + "";
		int increase = (lengthss.trim()).length();
		if (lengths != increase) {
			String In = "";
			for (int i = 0; i < lengths - increase; i++) {
				In = In + "0";
			}
			In = (In + lengthss).trim();
			Inc = In;
		} else {
			Inc = lengthss;
		}
		return Inc.trim();
	}

	public Double[] getRebateUnits() {
		return rebateUnits;
	}

	public void setRebateUnits(Double[] rebateUnits) {
		this.rebateUnits = rebateUnits;
	}

	public Double[] getRebatePrices() {
		return rebatePrices;
	}

	public void setRebatePrices(Double[] rebatePrices) {
		this.rebatePrices = rebatePrices;
	}

	public String[] getBarCodes() {
		return barCodes;
	}

	public void setBarCodes(String[] barCodes) {
		this.barCodes = barCodes;
	}

	public Product[] getProducts() {
		return products;
	}

	public void setProducts(Product[] products) {
		this.products = products;
	}

	public FundsInBar getFundsInBar() {
		return fundsInBar;
	}

	public void setFundsInBar(FundsInBar fundsInBar) {
		this.fundsInBar = fundsInBar;
	}

	public PurchaseReturnedStoreOut getPurchaseReturnedStoreOut() {
		return purchaseReturnedStoreOut;
	}

	public void setPurchaseReturnedStoreOut(
			PurchaseReturnedStoreOut purchaseReturnedStoreOut) {
		this.purchaseReturnedStoreOut = purchaseReturnedStoreOut;
	}

	public PurchaseReturnedStoreOutDetail getPurchaseReturnedStoreOutDetail() {
		return purchaseReturnedStoreOutDetail;
	}

	public void setPurchaseReturnedStoreOutDetail(
			PurchaseReturnedStoreOutDetail purchaseReturnedStoreOutDetail) {
		this.purchaseReturnedStoreOutDetail = purchaseReturnedStoreOutDetail;
	}

	public FundsInBarService getFundsInBarService() {
		return fundsInBarService;
	}

	public void setFundsInBarService(FundsInBarService fundsInBarService) {
		this.fundsInBarService = fundsInBarService;
	}

	public PurchaseReturnedStoreOutService getPurchaseReturnedStoreOutService() {
		return purchaseReturnedStoreOutService;
	}

	public void setPurchaseReturnedStoreOutService(
			PurchaseReturnedStoreOutService purchaseReturnedStoreOutService) {
		this.purchaseReturnedStoreOutService = purchaseReturnedStoreOutService;
	}

	public PurchaseReturnedStoreOutDetailService getPurchaseReturnedStoreOutDetailService() {
		return purchaseReturnedStoreOutDetailService;
	}

	public void setPurchaseReturnedStoreOutDetailService(
			PurchaseReturnedStoreOutDetailService purchaseReturnedStoreOutDetailService) {
		this.purchaseReturnedStoreOutDetailService = purchaseReturnedStoreOutDetailService;
	}

	public BankAccount getBankAccount() {
		return bankAccount;
	}

	public void setBankAccount(BankAccount bankAccount) {
		this.bankAccount = bankAccount;
	}

	public BankAccountService getBankAccountService() {
		return bankAccountService;
	}

	public void setBankAccountService(BankAccountService bankAccountService) {
		this.bankAccountService = bankAccountService;
	}

	public Collection<BankAccount> getBankAccounts() {
		return bankAccounts;
	}

	public void setBankAccounts(Collection<BankAccount> bankAccounts) {
		this.bankAccounts = bankAccounts;
	}

	public Collection<PurchaseReturnedStoreOutDetail> getSlist() {
		return slist;
	}

	public void setSlist(Collection<PurchaseReturnedStoreOutDetail> slist) {
		this.slist = slist;
	}

	public ProductStore getProductStore() {
		return productStore;
	}

	public void setProductStore(ProductStore productStore) {
		this.productStore = productStore;
	}

	public ProductStoreService getProductStoreService() {
		return productStoreService;
	}

	public void setProductStoreService(ProductStoreService productStoreService) {
		this.productStoreService = productStoreService;
	}

	public Detail getDetailz() {
		return detailz;
	}

	public void setDetailz(Detail detailz) {
		this.detailz = detailz;
	}

	public DetailService getDetailService() {
		return detailService;
	}

	public void setDetailService(DetailService detailService) {
		this.detailService = detailService;
	}

	public String getListString() {
		return listString;
	}

	public void setListString(String listString) {
		this.listString = listString;
	}

	public String getEncode() {
		return Encode;
	}

	public void setEncode(String encode) {
		Encode = encode;
	}

	public CodeInvoice getCodeInvoice() {
		return codeInvoice;
	}

	public void setCodeInvoice(CodeInvoice codeInvoice) {
		this.codeInvoice = codeInvoice;
	}

	public CodeInvoiceService getCodeInvoiceService() {
		return codeInvoiceService;
	}

	public void setCodeInvoiceService(CodeInvoiceService codeInvoiceService) {
		this.codeInvoiceService = codeInvoiceService;
	}

	public Code getCode() {
		return code;
	}

	public void setCode(Code code) {
		this.code = code;
	}

	public CodeService getCodeService() {
		return codeService;
	}

	public void setCodeService(CodeService codeService) {
		this.codeService = codeService;
	}

	public Collection<CodeInvoice> getCodelist() {
		return codelist;
	}

	public void setCodelist(Collection<CodeInvoice> codelist) {
		this.codelist = codelist;
	}

	public List<PurchaseStoreInDetail> getDetailIn() {
		return detailIn;
	}

	public void setDetailIn(List<PurchaseStoreInDetail> detailIn) {
		this.detailIn = detailIn;
	}

	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String[] getDetailAll() {
		return detailAll;
	}

	public void setDetailAll(String[] detailAll) {
		this.detailAll = detailAll;
	}

	public Integer[] getStoreinNum() {
		return storeinNum;
	}

	public void setStoreinNum(Integer[] storeinNum) {
		this.storeinNum = storeinNum;
	}

	public PurchaseStoreInDetailService getPurchaseStoreInDetailService() {
		return purchaseStoreInDetailService;
	}

	public void setPurchaseStoreInDetailService(
			PurchaseStoreInDetailService purchaseStoreInDetailService) {
		this.purchaseStoreInDetailService = purchaseStoreInDetailService;
	}

	public String getCount() {
		return count;
	}

	public void setCount(String count) {
		this.count = count;
	}

	public PaymentOrderService getPaymentOrderService() {
		return paymentOrderService;
	}

	public void setPaymentOrderService(PaymentOrderService paymentOrderService) {
		this.paymentOrderService = paymentOrderService;
	}

}
